package com.luci.security.result;

import java.io.Serializable;

/**
 * 返回值抽象类
 *
 * @author yuyanan
 * @since 2019/5/14
 */
public abstract class AuthResultAdapter<T> implements Serializable {

    /**
     * 数据对象
     */
    protected T data;

    /**
     * 登陆成功时的返回值
     *
     * @return AuthResultAdapter
     */
    public abstract AuthResultAdapter loginSuccess();


    /**
     * 登陆失败时的返回值
     *
     * @return AuthResultAdapter
     */
    public abstract AuthResultAdapter loginFail();

    /**
     * 没有携带token时，访问需要授权接口的返回值
     *
     * @return AuthResultAdapter
     */
    public abstract AuthResultAdapter noToken();

    /**
     * 没有权限时的返回值
     *
     * @return AuthResultAdapter
     */
    public abstract AuthResultAdapter acessDenied();

    public AuthResultAdapter(T data) {
        this.data = data;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
